const path = require('path');
function resolve(dir){
    return path.join(__dirname,dir);
}
module.exports = {
    chainWebpack:config=>{
        config.resolve.alias
            .set('@',resolve("src"))
    },
    devServer:{
        // Paths
        host: "localhost",
        port: 8081,
            proxy: {
                '/ws': {
                    target: 'ws://localhost:3030',
                    changeOrigin: !![],
                    ws:!![],
                    pathRewrite:{
                        '^/ws': ''
                    }
                },
                '/api': {
                    target: 'http://localhost:3012', // 要跨域的域名
                    changeOrigin: !![], // 是否开启跨域
                    pathRewrite: {
                        '^/api': '' // 重写路径
                    }
                },
                '/amap':{
                    target:"https://m.amap.com",
                    changeOrigin:!![],
                    pathRewrite:{
                        '^/amap':""
                    }
                }
            }
    }

}